package com.mobisys.live.dao.mapper;

import com.mobisys.live.dao.model.Live;
import com.mobisys.live.dao.model.LiveWithBLOBs;
import org.apache.ibatis.annotations.Param;
import org.omg.PortableServer.LIFESPAN_POLICY_ID;
import org.springframework.stereotype.Repository;



import java.util.List;
@Repository
public interface LiveMapper {
    int deleteByPrimaryKey(String id);

    int insert(LiveWithBLOBs record);

    int insertSelective(LiveWithBLOBs record);

    LiveWithBLOBs selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(LiveWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(LiveWithBLOBs record);

    int updateByPrimaryKey(Live record);

    //取出一个频道中的当前直播
    LiveWithBLOBs selectByChannelId(String channelId);

    //取出频道中的直播列表
    List<LiveWithBLOBs> selectLiveListByChannelId(String channelId);

    List<LiveWithBLOBs> selectLiveListByChannelid(String channelId);
    // 分页查询
    List<Live> findAll(int currIndex, int pagesize, String type);
    //更新
    int updateByliveId(String liveid,int status);



    //根据不同条件返回不同分布查询的结果
    List<LiveWithBLOBs> selectByPage(@Param("page") int page, @Param("size") int size,@Param("type") String type,@Param("sort") String sort);

    //更具用户id查找用户当前的所有直播
    List<LiveWithBLOBs> selectLiveListByUserId(String userId);

}